﻿#include "ssException.h"

namespace StarSeeker
{
	ssException::ssException(const std::string& message)
	{
		ssCallStack::instance()->GetCallStack(m_stackTrace);
		m_message = message;
	}

	ssException::ssException(const char* message)
	{
		ssCallStack::instance()->GetCallStack(m_stackTrace);
		m_message = message;
	}

	ssException::ssException()
	{
		ssCallStack::instance()->GetCallStack(m_stackTrace);
		m_message.clear();
	}

	ssException::ssException(int errorNum)
	{
		ssCallStack::instance()->GetCallStack(m_stackTrace);
		m_message[0] = 0;
		m_message = "throw error num: ";
		m_message += errorNum;
	}

	const char* ssException::GetErrorMsg()
	{
		return m_message.c_str();
	}

	const char* ssException::GetStackTrace()
	{
		return m_stackTrace.c_str();
	}
}
